<template>
  <div>

      <mh></mh>

    <main class="" id="main-collapse">
      <div>


        <!--面包屑导航-->
        <Breadcrumb :datas="datas">
        </Breadcrumb>

        <br /><br />

        <h1>{{ title }}</h1>

        <br /><br />

        <p>{{ desc }}</p >

        <br /><br />

        <p></p >


        <img :src="src" width="500">


      </div>

    </main>





  </div>
</template>



<script>


import mh from './mh.vue'

export default {
  data () {
    return {
      msg: "这是一个变量",
      //面包屑变量
      datas:[{title:'首页',route:{name:'index'}},{title:'当前课程'}],
      title:'',
      desc:'',
      src:''

    }
  },
  components: {
        'mh':mh
  },
  mounted:function(){

      //接收参数
      var id = this.$route.query.id;
      console.log(id);


      //使用箭头函数
      this.axios.get('http://localhost:8000/app01/singlecourse/',{params:{id:id}}).then((result) => {

        console.log(result);

        //赋值
        this.title = result.data.title;
        this.desc = result.data.desc;
        this.src = 'http://localhost:8000/static/upload/'+result.data.img;
        this.datas[1].title = result.data.title;

    });

},
  methods:{


  }
}


</script>

<style>



</style>
